﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Collections;
using System.Data;
using CE.Database;

/// <summary>
/// Summary description for CCPersonnelDB
/// </summary>
/// 
namespace CE.CreditCard
{
    public class CCPersonnelDB
    {
        public CCPersonnelDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Int64 Insert(CCPersonnel ccpersonnel)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "sprocCCApplicantPersonnelInsertUpdateSingleItem";

            SortedList _sPara = new SortedList();

            _sPara.Add("@CCPersonnelId", ccpersonnel.CCPersonnelId);
            _sPara.Add("@CCCARId", ccpersonnel.CCARId);
            _sPara.Add("@CCSalutation", ccpersonnel.CCSalutation);
            _sPara.Add("@CCFirstName", ccpersonnel.CCFirstName);
            _sPara.Add("@CCSurName", ccpersonnel.CCSurName);
            _sPara.Add("@CCNameOfAppear", ccpersonnel.CCNameOfAppear);
            _sPara.Add("@CCNationality", ccpersonnel.CCNationality);
            _sPara.Add("@CCIdType", ccpersonnel.CCIdType);
            _sPara.Add("@CCIdNo", ccpersonnel.CCIdNo);
            _sPara.Add("@CCDOB", ccpersonnel.CCDOB);
            _sPara.Add("@CCGender", ccpersonnel.CCGender);
            _sPara.Add("@CCMaritalStatus", ccpersonnel.CCMaritalStatus);
            _sPara.Add("@CCNoOfDependents", ccpersonnel.CCNoOfDepent);
            _sPara.Add("@CCHighestEdu", ccpersonnel.CCHighEdu);
            _sPara.Add("@CCEmail", ccpersonnel.CCEmail);
            _sPara.Add("@CCMobilePhoneNo", ccpersonnel.CCMobileNo);
            _sPara.Add("@CCHomePhoneNo", ccpersonnel.CCHomePhone);
            _sPara.Add("@CCOfficePhoneNo", ccpersonnel.CCOfficePhone);
            _sPara.Add("@CCUnitNo", ccpersonnel.CCUnitNo);
            _sPara.Add("@CCHomeNo", ccpersonnel.CCHomeNo);
            _sPara.Add("@CCStreetName", ccpersonnel.CCStreetName);
            _sPara.Add("@CCCountry", ccpersonnel.CCCountry);
            _sPara.Add("@CCPostalCode", ccpersonnel.CCPostalCode);
            _sPara.Add("@CCYearsThere", ccpersonnel.CCYearsofThere);
            _sPara.Add("@CCEmergencyNo", ccpersonnel.CCEmergencyNo);
            _sPara.Add("@CCEContactRelation", ccpersonnel.CCRelation);
            _sPara.Add("@CCMailing", ccpersonnel.CCMailing == true ? 1 : 0);
            _sPara.Add("@CCSupplementary", ccpersonnel.CCSupplementary == true ? 1 : 0);
            _sPara.Add("@RefCEUserId", ccpersonnel.RefCEUserId);
            _sPara.Add("@ViewedDetailId", ccpersonnel.ViewedDetailId);
            _sPara.Add("@Status", ccpersonnel.CCStatus == true ? 1 : 0);

            _sPara.Add("@Info1", ccpersonnel.CCInfo1);
            _sPara.Add("@Info2", ccpersonnel.CCInfo2);
            _sPara.Add("@Info3", ccpersonnel.CCInfo3);
            _sPara.Add("@Info4", ccpersonnel.CCInfo4);
            _sPara.Add("@Info5", ccpersonnel.CCInfo5);

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }


    }
}
